<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let arr = ['xiaodu', 'niubi', '夜阑卧听风吹雨', 8848, 'xixi']
    arr[3] = '铁马冰河入梦来'
    // document.write(arr)
    // document.write('<br>')
    len1 = arr.push('醉里挑灯看剑', '梦回吹角连营')
    len2 = arr.unshift('八百里分麾下炙', '五十弦翻塞外声')
    // document.write(`${len1}<br>${len2}<br>${arr}`)
    arr1 = arr.pop()
    arr2 = arr.shift()
    // document.write(arr1, arr2)
    let arr3 = [1, 2, 'haha', 4, 5]
    arr3.splice(2, 1, '3')
    document.write(arr3)
  </script>
</body>

</html>